﻿using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using ProductDemo.Models;

namespace ProductDemo.Business
{
    public static class InsertData
    {
        public static void AddProudctUnit()
        {
            for (var i = 0; i < 10; i++)
            {
                var productUnit = new ProductUnit
                {
                   
                    ProductUnitName = String.Format("产品单位测试数据{0}", i.ToString(CultureInfo.InvariantCulture))
                };
                using (var ctx = new EFTestEntities())
                {
                    ctx.ProductUnit.Add(productUnit);
                    ctx.SaveChanges();
                }

            }

        }
    }
}
